package com.zxx.good.config.exception;

import lombok.Data;

@Data
public class BusinessException extends RuntimeException {

    private int code;
    private String message;

    public BusinessException(String message) {
        this.code = -1;
        this.message = message;
    }

    public BusinessException(int code, String message) {
        this.message = message;
        this.code = code;
    }

    public BusinessException(BusinessExceptionEnum enums) {
        this.message = enums.getMessage();
        this.code = enums.getCode();
    }
}
